

********************************************************************************
*
* WHY GOVERNMENTS HAVE THEIR TROOPS TRAINED ABROAD:
* EVIDENCE FROM LATIN AMERICA
*
* By Adam Scharpf
*
* International Studies Quarterly
*
* June 2020
*
********************************************************************************
*
* Content:	Replication of Figure SI.2.2	
*
*			Steps:
*			1) Set working directory
*			2) Run do-file to replicate Figure SI.2.2 in the SI
*
********************************************************************************
*
* Packages: Before running this code, please make sure you have the following
*			.ado-files installed:
*
*			- SPMAP Package, Version 1.3.0
*					net install spmap
*
********************************************************************************

	version 15.1
	set more off

	clear all
  
 
 
********************************************************************************
*
* Setting working directory in macro
*
********************************************************************************

	*Insert path to folder containing dataset "data_figureSI22.dta" and "data_figureSI22coords.dta" before running
	global path="..." //Example: "C:\Users\me\Desktop\Scharpf\"
	
	
********************************************************************************
*
* Replicating Figure SI.2.2
*
********************************************************************************

	*Loading Figure SI.2.2 dataset
	use "$path\data_figureSI22.dta"

	*Figure SI.2.2
	#delimit ;
		spmap 
		soaavg
		using "$path\data_figureSI22coords.dta" if gwno>20, id(id)  //SOA activity
		clmethod(custom) fcolor(Reds) clbreaks(0 .9 5 10 20 40 60 120 180) 
		legtitle("Average number of" "courses attended annually") 
		legend(symy(*1.0) symx(*1.0) size(*1.0)
		label(2 "[0]") label(3 "[1,5]") label(4 "(5,10]") label(5 "(10,20]") 
		label(6 "(20,40]") label(7 "(40,60]") label(8 "(60,120]") label(9 "(120,180]"))
		ndfcolor(gs10)
		;
	#delimit cr
	graph export "$path\figureSI22.pdf", replace as(pdf)
		

********************************************************************************		
********************************************************************************
	
	*Closing graph windows
	graph close _all 
	
	*Clearing data
	clear all	
	
	